home *** CD-ROM | disk | FTP | other *** search
- ' ===========================================================================
- ' ImageDTInfo by © 1999-2000 Dámaso D. Estévez
- ' Fido : 2:348/613.44
- ' Inet : amidde@arrakis.es
- ' WWW : http://www.arrakis.es/~amidde/
- '
- ' ImageDTInfo.bas (main code/código principal)
- '
- ' For to compile this, use the compiler prefs file "HBCImageDTInfo.opts"
- ' (the `Tokens.t' file IS NEEDED for to compile this code...
- ' except if you include the `Tokens.bas' code in this code at start).
- ' -----------
- ' Para compilar este programa utilice el fichero de prefencias
- ' del compilador "HBCImageDTInfo.opts" (el fichero `Tokens.t'
- ' ES NECESARIO para poder compilar el programa...
- ' salvo si incluye el código de `Tokens.bas' al inicio de este código :D).
- ' ===========================================================================
- ' Created for use with FWCalendar Arexx script written by Ron Goertz
- ' and as a little coding exercise with (Hisoft|Maxon) Basic 2.
- ' You can re-use freely this code in your own works.
- ' ------------
- ' Creado para usar con el guión ARexx FWCalendar de Ron Goertz
- ' y como un pequeño ejercicio de programación con (Hisoft|Maxon) Basic 2.
- ' Puede reutilizar libremente este código en sus producciones.
- ' ===========================================================================
-
- ' -- Locale support --
- ' -- Soporte local ---
- ' --------------------
- REM $include BH:BLib/GetCString.bas
- REM $include Locale/ImageDTInfo_Locale.bc
- REM $include Locale/ImageDTInfo_Locale.bas
-
- DIM SHARED localeInfo&(2)
-
- FUNCTION CadLc$(BYVAL id&)
- CadLc$ = PEEK$(GetCString&(VARPTR(localeInfo&(0)),id&))
- END FUNCTION
-
- ' - Loading my modules with functions/subroutines -
- ' - Cargando mis módulos con funciones/subrutinas -
- ' -------------------------------------------------
- REM $include AuxRoutines/GetArg.bas
- REM $include AuxRoutines/InfoImgFile.bas
-
- ' =====================================================================
- ' Main code / Código principal
- ' =====================================================================
-
- ' ---- Opening libraries ----
- ' - Apertura de bibliotecas -
- ' ---------------------------
-
- ' OpenCatalogA(), CloseCatalog()
- LIBRARY OPEN "locale.library",39
-
- ' --------- Shared vars for error handling --------
- ' -- Variables compartidas de gestión de errores --
- ' -------------------------------------------------
- en& = 0&
- em$ = ""
-
- ' ----------- Opening locale library ---------
- ' - Apertura biblioteca de prestación local --
- ' --------------------------------------------
- localeInfo&(0) = LIBRARY("locale.library")
- IF localeInfo&(0) <> NULL& THEN
- localeInfo&(1) = OpenCatalogA&(NULL&, SADD("ImageDTInfo.catalog" + CHR$(0)), NULL&)
- END IF
-
- ' ---- Calling the main routine ----
- ' - Llamando a la rutina principal -
- ' ----------------------------------
- CALL main(COMMAND$)
-
- IF LIBRARY("locale.library") <> NULL& THEN
- CloseCatalog localeInfo&(1)
- END IF
-
- END
-
- ' =====================================================================
- ' "Main"subroutine / Sub-rutina "Main"
- ' =====================================================================
-
- SUB main(cad$) SHARED en&,em$
- LOCAL tmp$,version$
-
- ' -- Variables initialization ---
- ' - Inicialización de variables -
- '--------------------------------
-
- ' Copyright string / Cadena de autoría
- version$ ="$VER: ImageDTInfo 1.5 (26.5.00) by © Dámaso D. Estévez <amidde@arrakis.es>"
-
- ' ---- Asking the first argument ----
- ' - Solicitando el primer argumento -
- ' -----------------------------------
- cad$=getarg$(cad$,1)
-
- ' - There is the argument? -
- ' ---- ¿Hay argumento? -----
- ' --------------------------
- IF cad$<>"" THEN
-
- tmp$=InfoImgFile$(cad$)
-
- IF tmp$<>"" AND en&=0 AND em$="" THEN
-
- PRINT tmp$
-
- ELSE
-
- ' --------- If there was some error, -----------
- ' ------ prints the error code (& message) -----
-
- ' - Si se ha producido algún error, se imprime -
- ' ------ el código (y el mensaje de error) -----
- ' ----------------------------------------------
-
- PRINT CadLc$(ERROR_TITLE&);
- IF en&<>0 THEN
- PRINT " - ";CadLc$(ERROR_CODE_INFO&);": ";en&
- ELSE
- PRINT
- END IF
-
- PRINT CadLc$(ERROR_ARG_INFO&)": `";cad$;"'"
-
- IF em$<>"" THEN
- PRINT em$
- END IF
-
- END IF
-
- ELSE
-
- ' -------- The user didn't include a filename as argument ----------
- ' - El usuario no ha incluído un nombre de fichero como argumento --
- ' ------------------------------------------------------------------
- PRINT
-
- PRINT RIGHT$(version$,LEN(version$)-6)
- PRINT
- PRINT CadLc$(ERROR_ONLY_ONE_ARG&)
- PRINT
-
- END IF
-
- END SUB
-